package hanjia;

import java.util.LinkedList;

/**
 * Description:
 * Author:    Dane
 * CreateTime:2025/1/19-下午8:16
 * Since  :   1.0
 * Version:   1.0
 */
public class DoublyLinkedListSentinel {


    private static class Node {
        Node pre;
        int value;
        Node next;

        public Node(Node pre, Node next, int value) {
            this.pre = pre;
            this.next = next;
            this.value = value;
        }
    }

    private Node sentinel = new Node(null, null, 111);

    public DoublyLinkedListSentinel() {
        sentinel.pre = sentinel;
        sentinel.next = sentinel;
    }


    public void addFirst(int value) {
        Node a=sentinel;
        Node b = sentinel.next;
        Node now = new Node(a, b, value);
        a.next = now;
        b.pre = now;
        LinkedList<Integer> integers = new LinkedList<>();
    }
}
